package com.hmdp.config;

import org.redisson.Redisson;
import org.redisson.api.RedissonClient;
import org.redisson.client.RedisClient;
import org.redisson.config.Config;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * @Author Mr.Wen
 * @Version 1.0
 * 添加redisson的配置
 * 用于分布式锁
 */
@Configuration
public class RedissonConfig {
    @Bean
    public RedissonClient redisClient() {
        Config config = new Config();
        config.useSingleServer().setAddress("redis://192.168.220.103:6379").setPassword("123456");
        /*创建redisClient对象*/
        return Redisson.create(config);
    }
}
